<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>

    <link href="__WCSS__/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@1.6/lib/index.css">

	<style>
		.mui-input-group:before{
			height:0px
		}
		.mui-input-group:after{
			height: 0px;
		}
		.header{
			background:#1f253d;
			top:0;
			box-shadow:0 0px 0px #ccc;
			-webkit-box-shadow:0 0px 0px #ccc;
		}
		.h1{
			font-family:'微软雅黑';
			color: #fff;
		}
		.form{
			position:absolute;
			top:15%;
			height:0px;
			width:80%;
			left:0px;
			right:0px;
			margin: auto;
		}
		.formdiv{
			height:em;
			border-radius:30px;
			background-color:#fff;
			margin-bottom:30px;
		}
		.formimg{
			position:absolute;
			width: 35px;
			margin-left:15px;
			margin-top:5px;
		}
		.forminput{
			color:#0062CC;
			margin-top:2px;
			margin-left:18%;
			font-size:0.9em;
			font-family:'微软雅黑';
		}
		.button{
			position:absolute;
			background:#fff;
			font-family:'微软雅黑';
			left:60%;
			top:5px;
			font-size:0.9em;
			color:#242424;
			width:35%;
			border:0px solid;
		}
		.button2{
			line-height:2em;
			font-size:0.9em;
			width:90%;
			font-family:'微软雅黑';
			border-radius:30px;
			border:0px solid;
			background:linear-gradient(45deg,BLUE,purple);
		}
	</style>
</head>
<body style="background: #1a1d2e;">
	<header class="mui-bar mui-bar-nav header">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="javascript:history.go(-1)"></a>
			<h1 class="mui-title h1">修改密码</h1>
		</header>
		<form class="mui-input-group form"  name="AddUser" action="{:U('User/set_password')}">
			<div class="mui-input-row formdiv">
				<img src="../Public/home/wap/images/shouji.png" class="formimg"/>
				<input type="number" class="forminput" value="{$info.account}" readonly="readonly" name="moblie" placeholder="请输入手机号">
			</div>
			<!-- <div class="mui-input-row formdiv">
				<img src="../Public/home/wap/images/yanzheng.png" class="formimg"/>
				<input type="number" class="forminput" placeholder="请输入验证码">
				<button type="input" class="mui-btn mui-btn-danger button" >| 获取验证码</button>
				
			</div> -->
			<div class="mui-input-row formdiv">
				<img src="../Public/home/wap/images/mima.png" class="formimg" />
				<input type="password" class="forminput" name="password" placeholder="请输入密码">
			</div>
			<div class="mui-input-row formdiv">
				<img src="../Public/home/wap/images/mima.png" class="formimg"/>
				<input type="password" class="forminput"  name="c_password" placeholder="请确认密码">
			</div>
			
			<br>
			<div class="mui-button-row">
				<button type="button" class="mui-btn mui-btn-danger button2" id="submit"  onclick="setps()" >修改</button>
			</div>
			<br>
					
				
		</form>
				
</body>
 <script type="text/javascript" src="__COM__/js/jquery-1.9.1.min.js" ></script>
 <script type="text/javascript" src="__COM__/layer/layer.js" ></script>
 <script type="text/javascript">

    function setps(){
        var thisform=document.forms['AddUser'];
		var   moblie=thisform.moblie.value;
        var   password=thisform.password.value;       
        var   c_password=thisform.c_password.value;

		if(password=='' || password==null){
            layer.msg('请输入密码');
            return false;
        }
		if(c_password=='' || c_password==null){
            layer.msg('请再次输入密码');
            return false;
        }
		if(password != c_password){
            layer.msg('两次密码不一致');
            return false;
        }
		
        var post_url = $("form[name='AddUser']").attr('action');
        var post_data= $("form[name='AddUser']").serialize();
		$("#submit").attr('disabled',true)
        $.ajax({
            type: "POST",
            url: post_url,
            data:post_data,
            dataType: "json",
            success: function(data){
                if(data.status==1){
                    layer.msg(data.msg);  //,data.url);
					setTimeout(function (args) {
						window.location.href = "{:U('User/ziliao')}";
					}, 3000); 
                }else{
                    layer.msg(data.msg);
                }
            }
        });
    }

</script>	
</html>